# -*- coding: utf-8 -*-

import os  
import time  
import tushare as ts  
import pandas as pd  
import easygui  as eg
def check(code, low, high):  
    df = ts.get_realtime_quotes(code)  
    e = df[['code','name','price','time']]  
    p = df['price']  
    print e   
    if float(p[0]) > low and float(p[0]) < high:  
        return True  
    else :  
        return False  
      
while True:  
    if check('sh', 3000, 3420) or check('600549',0,28):  
        eg.msgbox(msg='check the stock')
        exit()  
    time.sleep(30) 